<template>
    <div class="header">
        <div class="title">后台管理系统</div>
        <div class="user">
          <div><img src="@/assets/2.jpg"></div>
          <span>{{name}}</span>
        </div>
    </div>
</template>

<script>
import {getToken} from '@/util/token.js'
export default {
    data() {
        return {
            name: '',
        }
    },
    created(){
        this.name = getToken('username')
    }
}
</script>

<style scoped lang="less">
.header{
    line-height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title{
        width: 200px;
        height: 60;
        font-size: 20px;
        cursor: pointer;
    }
    .user{
        width: 60px;
        height: 60px;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        overflow: hidden;
        line-height: 10px;
        cursor: pointer;
        div{
            width: 30px;
            height: 30px;
            border-radius: 15px;
            overflow: hidden;
            img{
                width: 30px;
            }
        }
        span{
            font-size: 14px;
        }
    }
}
</style>